define(['text!./device.html', 'css!./device.css', 'cordova','plugins'], function(html) {
	avalon.templateCache['device'] = html;
	var vm = avalon.define({
		$id: "device",
		role: '',
		getRole: function() {
			vm.role = Router.contentList;
			if(vm.role == "self") {
				$('#person').html('为自己绑定设备')
			} else {
				$('#person').html('为家人绑定设备')
			}
		},
		init: function() {
			vm.getRole();
		},
		back: function() {
			Router.go('/relation/relation', JSON.stringify(vm.role));
		},
		goHome: function() {
			clearstorage('family');
			Router.go('/Home/Home');
		}
	});
});